ga.core.algorithm.util
Class PopulationUtil

java.lang.Object
  extended by ga.core.algorithm.util.PopulationUtil

public final class PopulationUtil
extends java.lang.Object

Utility class for handling populations.

Since:
11.08.2012
Author:
Stephan Dreyer

Constructor Summary
private PopulationUtil()
          Instantiation is not allowed.
 
Method Summary
static double getMaxFitness(IPopulation<?> pop)
          Gets the maximum fitness of the whole population.
static double getMeanFitness(IPopulation<?> pop)
          Gets the mean fitness of the whole population.
static double getMinFitness(IPopulation<?> pop)
          Gets the minimum fitness of the whole population.
static double[] getMinMeanMaxFitness(IPopulation<?> pop)
          Gets the minimum/mean/maximum fitness of the whole population as array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PopulationUtil

private PopulationUtil()
Instantiation is not allowed.

Since:
11.08.2012
Method Detail

getMaxFitness

public static double getMaxFitness(IPopulation<?> pop)
Gets the maximum fitness of the whole population.

Parameters:
pop - The population.
Returns:
The maximum fitness.
Since:
11.08.2012

getMinFitness

public static double getMinFitness(IPopulation<?> pop)
Gets the minimum fitness of the whole population.

Parameters:
pop - The population.
Returns:
The minimum fitness.
Since:
11.08.2012

getMeanFitness

public static double getMeanFitness(IPopulation<?> pop)
Gets the mean fitness of the whole population.

sum(fit(pop))/length(pop)

Parameters:
pop - The population.
Returns:
The mean fitness.
Since:
11.08.2012

getMinMeanMaxFitness

public static double[] getMinMeanMaxFitness(IPopulation<?> pop)
Gets the minimum/mean/maximum fitness of the whole population as array. The index of the elements is:

0 -> min
1 -> mean
2 -> max

Parameters:
pop - The population.
Returns:
The minimum fitness.
Since:
11.08.2012